package com.xuetang9.t9.hotel.services.impl;

import com.xuetang9.t9.hotel.beans.Arranging;
import com.xuetang9.t9.hotel.beans.TableType;
import com.xuetang9.t9.hotel.mapper.ITableTypeMapper;
import com.xuetang9.t9.hotel.services.IArrangingService;
import com.xuetang9.t9.hotel.services.ITableTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Stream;

/**
 * @ProjectName: MyHotelProject
 * @Package: com.xuetang9.t9.hotel.service.impl
 * @ClassName: TableTypeService
 * @Author: ChinaHp
 * @Description: 桌子类型服务层接口实现类
 * @Date: 2020/2/24 16:32
 * @Version: 1.0
 */
@Service
public class TableTypeService implements ITableTypeService {
    @Autowired
    private ITableTypeMapper mapper;
    @Autowired
    private IArrangingService arrangingService;

    @Override
    public boolean add(TableType tableType) {
        return mapper.add(tableType) > 0;
    }

    @Override
    public TableType toUp(int id) {
        return mapper.select(id);
    }

    @Override
    public boolean update(TableType tableType) {
        return mapper.update(tableType) > 0;
    }

    @Override
    public boolean del(int id) {
        return mapper.delete(id) > 0;
    }

    @Override
    public List<TableType> tables() {
        return mapper.queryAll();
    }

    @Override
    public List<TableType> tablesByArranging() {
        return mapper.selectByArr();
    }

    @Override
    public TableType queryByName(String name) {
        return mapper.getByName(name);
    }


}
